<?php echo $this->headLink()->appendStylesheet('/css/redmond/jquery-ui-1.8.5.custom.css') ?>
<script type="text/javascript" src="/jquery/jquery.blockUI.js"></script>
<script type="text/javascript" src="/jquery/jquery.validate.js"></script> 
<script type="text/javascript">
$(document).ready(function() { 
    $("#frmBid").validate({
    	highlight: function(element, errorClass) {
        	$(element).css({ backgroundColor: "rgb(240,150,150)"});
        },
        unhighlight: function(element, errorClass) {
            $(element).css({ backgroundColor: "rgb(160,255,165)"});
        },
        rules: 
        {
        	"price": {
        		required: true,
        		digits: true,
        		remote: {
    				url: "/ajax/checkMaxPrice.php",
    				type: 'POST',
    				dateType: 'json',
    				data: {
			        	price:function(){
							return $('#txtPrice').val();
						},
						maxprice:function(){
							return $('#hidPrice').val();
						}
    				}
    			}
            }
        },
        messages: {
            "price": {
           		required: "請輸入價格",
           		digits: "請輸入數字",
           		remote: "價格不能大於上限"
            }
        }
    });

    $.validator.addMethod(
		".cOffer", 
		function(value, element) {
			$(".radioBid").each(function(){
	        	if(count %2 == 0 && ($("input[name='" + ($(this).attr('name')) + "']:checked").val() == "reject")){
	        		if($("txtCOffer" + $(this).attr('id').substring(8)).val() == ""){
        				return false;
					}
					alert($(this).attr('id').substring(8));
	        	}
	    	});
	        return true;
		}, 
		"請輸入"); 

    $(".radioBid").live("change", function(){
        var status = true;
        var count = 0;
		var id = "";

        //if reject status, show counter offer box, otherwise, hide it
        if($("input[name='" + ($(this).attr('name')) + "']:checked").val() == "reject"){
            id = $(this).attr('name').substring(8);
            if(id == "Price"){
                $("#txtCOfferPrice").show();
            }
            else{
                $("#txtCOffer" + id).show();
            }
        }
        else if($("input[name='" + ($(this).attr('name')) + "']:checked").val() == "accept"){
        	id = $(this).attr('name').substring(8);
            if(id == "Price"){
                $("#txtCOfferPrice").hide();
            }
            else{
                $("#txtCOffer" + id).hide();
            }
        }
        
        //check has reject status or not
    	$(".radioBid").each(function(){
        	if(count %2 == 0 && ($("input[name='" + ($(this).attr('name')) + "']:checked").val() == undefined || $("input[name='" + ($(this).attr('name')) + "']:checked").val() == "reject")){
        		status = false;
        	}
        	count ++;
    	});

    	
    	if(status == true){
			$("#btnBid").attr("disabled", "");
        }
    	else if($('input:radio:checked').length == count/2 + 1){
        	$("#btnCOffer").attr("disabled", "");
        	$("#btnBid").attr("disabled", "disabled");
    	}
    	else{
    		$("#btnCOffer").attr("disabled", "");
    		$("#btnBid").attr("disabled", "disabled");
    	}
    });

    $(".pb-bid-seller").click(function(){
    	var id = $(this).attr('id').substring(0,9);
    	var pbid = $('#hidPbid').val();
    	var mid = $(this).attr('id').substring(9);

    	if (window.XMLHttpRequest){
    		/*** code for IE7+, Firefox, Chrome, Opera, Safari ***/
    	  	xmlhttp=new XMLHttpRequest();
    	}
    	else{
    		/*** code for IE6, IE5 ***/
    		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    	}

    	/*** make order ***/
    	xmlhttp.onreadystatechange=function(){
    		if (xmlhttp.readyState==4 && xmlhttp.status==200){
    	    	document.getElementById("ajaxOffer").innerHTML=xmlhttp.responseText;
    	    }
    	}
    	
    	xmlhttp.open("GET","/ajax/showSellerOffer.php?id=" + id + "&pbid=" + pbid + "&mid=" + mid, true);
    	
    	xmlhttp.send();
    });

    $(".pb-bid-buyer").click(function(){
    	var id = $(this).attr('id').substring(0,9);
    	var pbid = $('#hidPbid').val();
    	var mid = $(this).attr('id').substring(9);

    	if (window.XMLHttpRequest){
    		/*** code for IE7+, Firefox, Chrome, Opera, Safari ***/
    	  	xmlhttp=new XMLHttpRequest();
    	}
    	else{
    		/*** code for IE6, IE5 ***/
    		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    	}

    	/*** make order ***/
    	xmlhttp.onreadystatechange=function(){
    		if (xmlhttp.readyState==4 && xmlhttp.status==200){
    	    	document.getElementById("ajaxOffer").innerHTML=xmlhttp.responseText;
    	    }
    	}
    	
    	xmlhttp.open("GET","/ajax/showBuyerOffer.php?id=" + id + "&pbid=" + pbid + "&mid=" + mid, true);
    	
    	xmlhttp.send();
    });
    

    $(".sub-photo").click(function(){
        var src = $(this).children().attr("src");
		$("#ajaxAuctionPhoto").children().attr("src", src);
    });

    window.onload=function() {  
    	clock();
    }; 
});

//設定倒數之標的
<?php 
$creationTime = $this->prodBuyEntry[0]->creation_time;
$year = substr($creationTime ,0, strpos($creationTime ,"-"));
$month = substr($creationTime, 5, 2);
if($month == "01"){
	$month = "JAN";
}
else if($month == "02"){
	$month = "FEB";
}
else if($month == "03"){
	$month = "MAR";
}
else if($month == "04"){
	$month = "APR";
}
else if($month == "05"){
	$month = "MAY";
}
else if($month == "06"){
	$month = "JUN";
}
else if($month == "07"){
	$month = "JUL";
}
else if($month == "08"){
	$month = "AUG";
}
else if($month == "09"){
	$month = "SEP";
}
else if($month == "10"){
	$month = "OCT";
}
else if($month == "11"){
	$month = "NOV";
}
else if($month == "12"){
	$month = "DEC";
}
$day = substr($creationTime, 8, 2);
$time = substr($creation_time, -8);
$addday = $this->prodBuyEntry[0]->day;
?>
var DifferenceHour = -1
var DifferenceMinute = -1
var DifferenceSecond = -1
var Tday = new Date("<?php echo $month . " " . $day . ", " . $year . " " . $time;?>") 
Tday.setDate(Tday.getDate() + <?php echo $addday;?>)
var daysms = 24 * 60 * 60 * 1000
var hoursms = 60 * 60 * 1000
var Secondms = 60 * 1000
var microsecond = 1000


function clock()
{
	//取得現在的時間資料
	var time = new Date()
	var hour = time.getHours()
	
	var minute = time.getMinutes()
	var second = time.getSeconds()
	var timevalue = ""+((hour > 12) ? hour-12:hour)
	
	//設定日期格式
	timevalue +=((minute < 10) ? ":0":":")+minute
	timevalue +=((second < 10) ? ":0":":")+second
	timevalue +=((hour >12 ) ? " PM":" AM")
		
	//計算現在的時間資料與倒數標的之差異
	var convertHour = DifferenceHour
	var convertMinute = DifferenceMinute
	var convertSecond = DifferenceSecond
	
	//透過getTime出來會是毫秒的數字
	var Diffms = Tday.getTime() - time.getTime()
	
	//根據不同情況以相除得到不同標準的數字
	DifferenceHour = Math.floor(Diffms / daysms)
	Diffms -= DifferenceHour * daysms
	DifferenceMinute = Math.floor(Diffms / hoursms)
	Diffms -= DifferenceMinute * hoursms
	DifferenceSecond = Math.floor(Diffms / Secondms)
	Diffms -= DifferenceSecond * Secondms	
	
	//如果 hour 資料有改變，則 form 那邊也要改變
	if((DifferenceHour > 0 || DifferenceHour == -1) && DifferenceMinute > 0 && DifferenceSecond > 0){
		if(convertHour != DifferenceHour){
			day.innerHTML = DifferenceHour;
		}
		
		//如果 Minute 資料有改變，則 form 那邊也要改變
		if(convertMinute != DifferenceMinute) {
			ho.innerHTML = DifferenceMinute
		}
		
		//如果 Second 資料有改變，則 form 那邊也要改變
		if(convertSecond != DifferenceSecond) {
			min.innerHTML = DifferenceSecond
		}

		//如果 Second 資料有改變，則 form 那邊也要改變
		var dSecs = Math.floor(Diffms / microsecond)
		sec.innerHTML = dSecs
	}
	else{
		document.getElementById("ajaxTime").innerHTML = "已結束";
		
		if(document.getElementById("hidTimeOver").value != "F"){
			if (window.XMLHttpRequest){
	    		/*** code for IE7+, Firefox, Chrome, Opera, Safari ***/
	    	  	xmlhttp=new XMLHttpRequest();
	    	}
	    	else{
	    		/*** code for IE6, IE5 ***/
	    		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	    	}
	
	    	/*** make order ***/
	    	xmlhttp.onreadystatechange=function(){
	    		if (xmlhttp.readyState==4 && xmlhttp.status==200){
	    	    }
	    	}
	    	
	    	xmlhttp.open("GET","/ajax/updateStatus.php?pbid=" + document.getElementById("hidPbid").value, true);
	    	
	    	xmlhttp.send();

	    	window.location.reload();
		}
	}
	
	
	//每1000毫秒(即1秒)不斷自動呼叫 clock() 以更新秒數資料
	setTimeout("clock()",1000)
} 
</script>
<div id="global">
	<?php require_once '/template/left-sidebar.phtml';?>
	<?php $pb_bid_mapper = new Application_Model_ProductBuyBidMapper();?>
	<div id="content-with-oneside">
		<div id="bid-seller">
			<div id="bid-header"><?php echo $this->prodBuyEntry[0]->title;?></div>
			<div id="bid-content">
				<!-- Left Column -->
				<div id="left-col">
					<div id="auction-photo" class="border-with-shadow">
						<table id="tblPhoto">
							<tbody>
								<tr>
									<td class="sub-photo border-without-shadow">
										<?php 
										$pos = strrpos($this->prodBuyEntry[0]->image, "http");
										if ($pos === false) {
											list($width, $height, $type, $attr) = getimagesize("./././" . $this->prodBuyEntry[0]->image);
										}
										else{
											list($width, $height, $type, $attr) = getimagesize($this->prodBuyEntry[0]->image);
										}
										$newWidth = 0;
										$newHeight = 0;
										if($width >= $height){
											$newWidth = 70;
											$newHeight = $height * 70 / $width;
										}
										else if($height > $width){
											$newHeight = 70;
											$newWidth = $width * 70 / $height;
										}
										?>
										<img src="<?php echo $this->prodBuyEntry[0]->image;?>" width="<?php echo $newWidth;?>px" height="<?php echo $newHeight;?>px"></img>
									</td>
									<td rowspan="3" class="main-photo">
										<div id="ajaxAuctionPhoto">
											<?php 
										$pos = strrpos($this->prodBuyEntry[0]->image, "http");
										if ($pos === false) {
											list($width, $height, $type, $attr) = getimagesize("./././" . $this->prodBuyEntry[0]->image);
										}
										else{
											list($width, $height, $type, $attr) = getimagesize($this->prodBuyEntry[0]->image);
										}
										$newWidth = 0;
										$newHeight = 0;
										if($width >= $height){
											$newWidth = 68;
											$newHeight = $height * 68 / $width;
										}
										else if($height > $width){
											$newHeight = 68;
											$newWidth = $width * 68 / $height;
										}
										?>
											<img src="<?php echo $this->prodBuyEntry[0]->image;?>" width="370px" height="270px"></img>
										</div>
									</td>
								</tr>
								<tr>
									<td class="sub-photo border-without-shadow">
										<?php 
										$pos = strrpos($this->prodBuyEntry[0]->sub_image1, "http");
										if ($pos === false) {
											list($width, $height, $type, $attr) = getimagesize("./././" . $this->prodBuyEntry[0]->sub_image1);
										}
										else{
											list($width, $height, $type, $attr) = getimagesize($this->prodBuyEntry[0]->sub_image1);
										}
										$newWidth = 0;
										$newHeight = 0;
										if($width >= $height){
											$newWidth = 70;
											$newHeight = $height * 70 / $width;
										}
										else if($height > $width){
											$newHeight = 70;
											$newWidth = $width * 70 / $height;
										}
										?>
										<img src="<?php echo $this->prodBuyEntry[0]->sub_image1;?>" width="<?php echo $newWidth;?>px" height="<?php echo $newHeight;?>px"></img>
									</td>
								</tr>
								<tr>
									<td class="sub-photo border-without-shadow">
										<?php 
										$pos = strrpos($this->prodBuyEntry[0]->sub_image2, "http");
										if ($pos === false) {
											list($width, $height, $type, $attr) = getimagesize("./././" . $this->prodBuyEntry[0]->sub_image2);
										}
										else{
											list($width, $height, $type, $attr) = getimagesize($this->prodBuyEntry[0]->sub_image2);
										}
										$newWidth = 0;
										$newHeight = 0;
										if($width >= $height){
											$newWidth = 70;
											$newHeight = $height * 70 / $width;
										}
										else if($height > $width){
											$newHeight = 70;
											$newWidth = $width * 70 / $height;
										}
										?>
										<img src="<?php echo $this->prodBuyEntry[0]->sub_image2;?>" width="<?php echo $newWidth;?>px" height="<?php echo $newHeight;?>px"></img>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
					<div id="auction-description" class="border-with-shadow" style="overflow:visable;">
						<span style="overflow:visable;"><?php echo $this->prodBuyEntry[0]->description;?></span>
					</div>
				</div>
				<!-- Right Column -->
				<div id="right-col">
					<!-- Auction Box -->
					<div id="auction-detail" class="border-with-shadow">
						<input id="hidPbid" name="pbid" type="hidden" value="<?php echo $this->prodBuyEntry[0]->product_buy_id;?>">
						<input id="hidStatus" type="hidden" value="<?php echo $this->prodBuyEntry[0]->status;?>">
						<table id="tblDetail">
							<tbody>
								<tr>
									<td class='left'><b><?php echo $this->creator;?>:</b></td>
									<td class='right'>
										<a href="<?php echo $this->memberAction . $this->prodBuyEntry[0]->member_id;?>">
										<?php
											$member_mapper = new Application_Model_MemberMapper();
											$mbmEntry = $member_mapper->findByMemberId($this->prodBuyEntry[0]->member_id);
											echo $mbmEntry[0]->username;
										?>
										</a>
									</td>
								</tr>
								<tr>
									<td class='left'><b><?php echo $this->highest;?>:</b></td>
									<td class='right'>$<?php echo $this->prodBuyEntry[0]->price;?></td>
								</tr>
								<tr>
									<td class='left'><b><?php echo $this->quantity;?>:</b></td>
									<td class='right'><?php echo sizeof($this->prodBuyBidEntries);?></td>
								</tr>
								<?php if($this->prodBuyEntry[0]->status == "B"){?>
								<tr>
									<td colspan="2" class="center">
										<div id="ajaxTime">
											<div id="day"></div>天
											<div id="ho"></div>時
											<div id="min"></div>分
											<div id="sec"></div>秒
										</div>
									</td>
								</tr>
								<?php }?>
								<tr>
									<td colspan="2">.&nbsp;.&nbsp;.&nbsp;.&nbsp;.&nbsp;.&nbsp;.&nbsp;.&nbsp;.&nbsp;.&nbsp;.&nbsp;.&nbsp;.
										.&nbsp;.&nbsp;.&nbsp;.&nbsp;.&nbsp;.&nbsp;.&nbsp;.&nbsp;.&nbsp;.&nbsp;.&nbsp;.&nbsp;.&nbsp;.
										.&nbsp;.&nbsp;.&nbsp;.&nbsp;.&nbsp;.&nbsp;.&nbsp;.&nbsp;.
									</td>
								</tr>
								<?php 
								if($this->prodBuyEntry[0]->status == "F"){
									echo "<tr><td colspan='2' class='center'>";
									echo "<div id='ajaxOffer'>";
									echo "</br>" . $this->escape($this->finished);
									echo "</div>";
									echo "</td></tr>";
									$mbmEntry = $member_mapper->findByMemberId($this->prodBuyEntry[0]->winner);
									echo "<tr><td colspan='2' class='center'>" . $this->escape($this->winner);
									if($this->prodBuyEntry[0]->winner == NULL || $this->prodBuyEntry[0]->winner == ""){
										echo "沒有";
									}
									else{
										echo $mbmEntry[0]->username;
									}
										echo "</td></tr>";
								}
								else if($this->prodBuyEntry[0]->status == "B"){
									if($this->isBuyer == 'L'){
										echo "<tr><td colspan='2' class='center'>";
										echo "</br>" . $this->escape($this->loginPlease);
										echo "</td></tr>";
									}
									else if($this->isBuyer == 'Y'){
								?>
									<tr><td colspan='2' class='center'>
										<div id='ajaxOffer'>
									    	</br><?php echo $this->escape($this->chooseOffer);?>
										</div>
									</td></tr>
								<?php
									}
									else{
								?>
								
									<tr>
										<td colspan="2">
											<div id='ajaxOffer'>
								<?php 
										if($this->hasBid == 'N'){
								?>
												<form id="frmBid" method="post" action="<?php echo $this->escape($this->sellerBidAction)?>">
													<table id="tblBuyerOffer">
														<tr>
															<td><b><?php echo $this->offer;?></b></td>
														</tr>
														<tr>
															<td colspan="2" class="center">
																HKD<input id="txtPrice" name="price" type="text" size="15"/>
																<input id="hidPrice" type="hidden" value="<?php echo $this->prodBuyEntry[0]->price;?>"/>
															</td>
														</tr>
														<tr>
															<td colspan="2"><b><?php echo $this->condition;?></b></td>
														</tr>
														<tr>
															<td colspan="2" class="center">
																1.<input id="txtOffer1" name="offer1" type="text" maxlength="30"/>
															</td>
														</tr>
														<tr>
															<td colspan="2" class="center">
																2.<input id="txtOffer2" name="offer2" type="text" maxlength="30"/>
															</td>
														</tr>
														<tr>
															<td colspan="2" class="center">
																3.<input id="txtOffer3" name="offer3" type="text" maxlength="30"/>
															</td>
														</tr>
														<tr>
															<td colspan="2" class="center">
																<input id="btnBid" type="submit" value="<?php echo $this->bid;?>"/>
																<input id="hidPbid" name="pbid" type="hidden" value="<?php echo $this->prodBuyEntry[0]->product_buy_id;?>">
																<input id="hidOfferCounter" name="offerCounter" type="hidden" value="3">
															</td>
														</tr>
													</table>
												</form>
									<?php 
										}
										else if($this->hasBid == 'Y' && $this->hasCounterOffer == 'Y'){
									?>
												<table id="tblBuyerOffer">
													<tr>
														<td><b><?php echo $this->offer;?></b></td>
														<td><?php echo $this->accept;?></td>
														<td><?php echo $this->reject;?></td>
													</tr>
													<form id="frmCOffer" method="post" action="<?php echo $this->counterOfferAction;?>">
														<tr>
															<td>
																HKD $<?php echo $this->prodMbmBuyBidEntries[0]->price;?>
															</td>
															<td><input name="radioBidPrice" class="radioBid" type="radio" value="accept"></td>
															<td><input name="radioBidPrice" class="radioBid" type="radio" value="reject"></td>
														</tr>
														<tr>
															<td colspan="3"><input id="txtCOfferPrice" name="cOfferPrice" type="text" style="display:none"/></td>
														</tr>
														<tr>
															<td colspan="3"><b><?php echo $this->condition;?></b></td>
														</tr>
														<?php
															for($i = 0; $i < sizeof($this->prodBuyCOffEntries); $i++){
														?>
														<tr>
															<td>
																<?php echo $i + 1;?>.<label id="lblOffer<?php echo $i;?>"><?php echo $this->prodBuyCOffEntries[$i]->offer;?></label>
															</td>
															<td><input name="radioBid<?php echo $this->prodBuyCOffEntries[$i]->product_buy_offer_id;?>" class="radioBid" type="radio" value="accept"></td>
															<td><input name="radioBid<?php echo $this->prodBuyCOffEntries[$i]->product_buy_offer_id;?>" class="radioBid" type="radio" value="reject"></td>
														</tr>
														<tr>
															<td colspan="3">
																<input id="txtCOffer<?php echo $this->prodBuyCOffEntries[$i]->product_buy_offer_id;?>" 
																	name="cOffer<?php echo $this->prodBuyCOffEntries[$i]->product_buy_offer_id;?>" type="text" class="cOffer" style="display:none"/>
															</td>
														</tr>
														<?php
															} 
														?>
														<tr>
															<td>
																<input id="btnCOffer" type="submit" value="<?php echo $this->counterOffer;?>" disabled="disabled"/>
																<input id="hidPbid" name="pbid" type="hidden" value="<?php echo $this->prodBuyEntry[0]->product_buy_id;?>">
																<input id="hidPbBid" name="pbbid" type="hidden" value="<?php echo $this->prodMbmBuyBidEntries[0]->product_buy_bid_id;?>">
															</td>
														</tr>
													</form>
													<tr>
														<td colspan="3" class="center">
															<form id="frmCancelOffer1" method="post" action="<?php echo $this->escape($this->cancelOfferAction)?>">
																<input id="btnBid" type="submit" value="<?php echo $this->cancel;?>"/>
																<input id="hidPbBid" name="pbbid" type="hidden" value="<?php echo $this->prodMbmBuyBidEntries[0]->product_buy_bid_id;?>"/>
															</form>
														</td>
													</tr>
												</table>
								<?php 
								
										}
										else if($this->hasBid == 'Y' && $this->hasOffer == 'Y'){
								?>
												<table id="tblBuyerOffer">
													<tr>
														<td><b><?php echo $this->offer;?></b></td>
													</tr>
													<tr>
														<td colspan="2">
															HKD $<?php echo $this->prodMbmBuyBidEntries[0]->price;?>
														</td>
													</tr>
													<tr>
														<td colspan="2"><b><?php echo $this->condition;?></b></td>
													</tr>
													<?php
														for($i = 0; $i < sizeof($this->prodBuyOffEntries); $i++){
													?>
													<tr>
														<td colspan="2">
															<?php echo $i + 1;?>.<label id="lblOffer<?php echo $i;?>"><?php echo $this->prodBuyOffEntries[$i]->offer;?></label>
														</td>
													</tr>
													<?php
														}
													?>
													<tr>
														<td colspan="2" class="center">
															<form id="frmCancelOffer2" method="post" action="<?php echo $this->escape($this->cancelOfferAction)?>">
																<input id="btnBid" type="submit" value="<?php echo $this->cancel;?>"/>
																<input id="hidPbBid" name="pbbid" type="hidden" value="<?php echo $this->prodMbmBuyBidEntries[0]->product_buy_bid_id;?>"/>
															</form>
														</td>
													</tr>
												</table>
								<?php
										}
								?>
											</div>
										</td>
									</tr>
								<?php
									}
								}
								?>
							</tbody>
						</table>
					</div>
					<br/>
					<!-- Auction History -->
					<div id="auction-history" class="border-with-shadow">
						<div>
							<table id="tblHistory">
								<thead>
									<tr>
										<th colspan="<?php if($this->isBuyer == 'Y'){echo "4";}else{echo "2";}?>"><?php echo $this->history;?></th>
									</tr>
								</thead>
								<tbody>
									<tr>
										<td class="odd"><?php echo $this->bidder;?></td>
										<?php 
										if($this->isBuyer == 'Y'){
											echo "<td class='odd'>" . $this->price . "</td>";
										}
										?>
										<td class="odd"><?php echo $this->time;?></td>
										<?php 
										if($this->isBuyer == 'Y'){
											echo "<td class='odd'></td>";
										}
										?>
									</tr>
									<?php 
										if($this->isBuyer == 'Y'){
											for($i=0; $i < sizeof($this->prodBuyBidEntries); $i++){
									?>
									<tr id="<?php echo $this->prodBuyBidEntries[$i]->product_buy_bid_id . $this->prodBuyBidEntries[$i]->member_id;?>" class="pb-bid-seller">
										<td class="<?php if($i%2==0){echo "even";}else{echo "odd";}?>">
											<?php echo $this->prodBuyBidEntries[$i]->username;?>
										</td>
										<td class="<?php if($i%2==0){echo "even";}else{echo "odd";}?>">
											<?php echo $this->prodBuyBidEntries[$i]->price;?>
										</td>
										<td class="<?php if($i%2==0){echo "even";}else{echo "odd";}?>">
											<?php echo $this->prodBuyBidEntries[$i]->creation_time;?>
										</td>
										<td class="<?php if($i%2==0){echo "even";}else{echo "odd";}?>">
										<?php
											$pbBEntry = $pb_bid_mapper->findByPbIdMemberId($this->prodBuyEntry[0]->product_buy_id, $this->prodBuyBidEntries[$i]->member_id);
											if($this->prodBuyBidEntries[$i]->product_buy_bid_id == $pbBEntry[0]->product_buy_bid_id){
												echo "*";
											}
										?>
										</td>
									</tr>
									<?php 	
											}
										}
										else{
											for($i=0; $i < sizeof($this->prodBuyBidEntries); $i++){
									?>
									<tr id="<?php echo $this->prodBuyBidEntries[$i]->product_buy_bid_id . $this->prodBuyBidEntries[$i]->member_id;?>" 
										<?php if($this->mbmId == $this->prodBuyBidEntries[$i]->member_id){ echo "class='pb-bid-buyer'";}?>>
										<td class="<?php if($i%2==0){echo "even";}else{echo "odd";}?>"><?php echo $this->prodBuyBidEntries[$i]->username;?></td>
										<td class="<?php if($i%2==0){echo "even";}else{echo "odd";}?>"><?php echo $this->prodBuyBidEntries[$i]->creation_time;?></td>
									</tr>	
									<?php	
											}
										}
									?>
								</tbody>
							</table>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>